package com.contract.management.domain;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.contract.management.bean.ExtraData;

@Entity
public class Contract {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	//合同编号
	private String no;
	
	//1 电子合同，2 空白合同
	private int type;
	
	@ManyToOne
    @JoinColumn(name="company_id")
	private Config company;
	
	//地区（上海、苏州）
	private String area;
	
	//合同大类
	private String bigClass;
	
	//合同小类
	private String smallClass;
	
	@ManyToOne
    @JoinColumn(name="small_class_id")
	private ContSmallClass contSmallClass;
	
	//业务类型
	private String ywlx;
	
	//一次/分期
	private String ycfq;
	
	//是否宏金保
	private boolean isHjb;
	
	//是否有附加条款
	private boolean hasFjtk;

	//甲方_委托人
	private String jfWtr;

	//甲方_通信地址
	private String jfTxdz;

	//甲方_联系人
	private String jfLxr;

	//甲方_网址
	private String jfWz;

	//甲方_电话号码
	private String jfDhhm;

	//甲方_移动电话
	private String jfYddh;

	//甲方_电子邮件
	private String jfDzyj;

	//乙方_受托人
	private String yfWtr;

	//乙方_联系地址
	private String yfTxdz;

	//乙方_联系人
	private String yfLxr;

	//乙方_网址
	private String yfWz;

	//乙方_电话号码
	private String yfDhhm;

	//乙方_传真号码
	private String yfCzhm;

	//乙方_电子邮件
	private String yfDzyj;

	//退款情形发生时，甲方可要求乙方退款账户
	private String tkzh;

	//费用合计
	private int fyhj;
	
	//正常价格
	private int zcjg;
	
	//分期首付款
	private Integer firstPay;
	
	//分期尾款支付时间
	//@DateTimeFormat(pattern = "yyyy-MM-dd")
	private String lastPayDate;

	//付款方式（1转账、2支票、3现金、4支付宝）
	private int fkfs;

	//创建人
	@ManyToOne
    @JoinColumn(name="user_id")
	private User user;

	//审核人
	@ManyToOne
    @JoinColumn(name="audit_id")
	private User audit;
	
	//0审核中合同,1已通过合同,-1未通过合同
	private int status;
	
	//合同流程当前节点
	@ManyToOne
    @JoinColumn(name="cur_node")
	private WorkflowNode curNode;
	
	//合同流程当前节点说明
	private String nodeInfo;
	
	//流程下一操作
	private String nextOper;
	
	//创建时间
	private Date createTime;

	//合同文档名称
	private String docName;
	
	@Transient
	private ExtraData data;
	
	
	//附加数据（JSON）
	private String extraData;
	
	//备注
	private String memo;
	
	//附加条款（增加）
	private String fjtkAdd;
	
	//附加条款（删除）
	private String fjtkDel;
	
	//商标条目
	@Transient
	private List<SbItems> sbItems;
	
	
	//公司账户
	private String account;
	
	//开户银行
	private String bank;
	
	//银行账号
	private String bankNumber;
	
	//支付宝企业账户
	private String zfbBank;
	
	//审批理由
	private String auditMemo;
	
	private Date finishTime;
	
	public Contract() {
	}

	public Contract(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public Config getCompany() {
		return company;
	}

	public void setCompany(Config company) {
		this.company = company;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getBigClass() {
		return bigClass;
	}

	public void setBigClass(String bigClass) {
		this.bigClass = bigClass;
	}

	public String getSmallClass() {
		return smallClass;
	}

	public void setSmallClass(String smallClass) {
		this.smallClass = smallClass;
	}

	public ContSmallClass getContSmallClass() {
		return contSmallClass;
	}

	public void setContSmallClass(ContSmallClass contSmallClass) {
		this.contSmallClass = contSmallClass;
	}

	public String getYwlx() {
		return ywlx;
	}

	public void setYwlx(String ywlx) {
		this.ywlx = ywlx;
	}

	public String getYcfq() {
		return ycfq;
	}

	public void setYcfq(String ycfq) {
		this.ycfq = ycfq;
	}

	public boolean getIsHjb() {
		return isHjb;
	}

	public void setIsHjb(boolean isHjb) {
		this.isHjb = isHjb;
	}

	public String getJfWtr() {
		return jfWtr;
	}

	public void setJfWtr(String jfWtr) {
		this.jfWtr = jfWtr;
	}

	public String getJfTxdz() {
		return jfTxdz;
	}

	public void setJfTxdz(String jfTxdz) {
		this.jfTxdz = jfTxdz;
	}

	public String getJfLxr() {
		return jfLxr;
	}

	public void setJfLxr(String jfLxr) {
		this.jfLxr = jfLxr;
	}

	public String getJfWz() {
		return jfWz;
	}

	public void setJfWz(String jfWz) {
		this.jfWz = jfWz;
	}

	public String getJfDhhm() {
		return jfDhhm;
	}

	public void setJfDhhm(String jfDhhm) {
		this.jfDhhm = jfDhhm;
	}

	public String getJfYddh() {
		return jfYddh;
	}

	public void setJfYddh(String jfYddh) {
		this.jfYddh = jfYddh;
	}

	public String getJfDzyj() {
		return jfDzyj;
	}

	public void setJfDzyj(String jfDzyj) {
		this.jfDzyj = jfDzyj;
	}

	public String getYfWtr() {
		return yfWtr;
	}

	public void setYfWtr(String yfWtr) {
		this.yfWtr = yfWtr;
	}

	public String getYfTxdz() {
		return yfTxdz;
	}

	public void setYfTxdz(String yfTxdz) {
		this.yfTxdz = yfTxdz;
	}

	public String getYfLxr() {
		return yfLxr;
	}

	public void setYfLxr(String yfLxr) {
		this.yfLxr = yfLxr;
	}

	public String getYfWz() {
		return yfWz;
	}

	public void setYfWz(String yfWz) {
		this.yfWz = yfWz;
	}

	public String getYfDhhm() {
		return yfDhhm;
	}

	public void setYfDhhm(String yfDhhm) {
		this.yfDhhm = yfDhhm;
	}

	public String getYfCzhm() {
		return yfCzhm;
	}

	public void setYfCzhm(String yfCzhm) {
		this.yfCzhm = yfCzhm;
	}

	public String getYfDzyj() {
		return yfDzyj;
	}

	public void setYfDzyj(String yfDzyj) {
		this.yfDzyj = yfDzyj;
	}

	public String getTkzh() {
		return tkzh;
	}

	public void setTkzh(String tkzh) {
		this.tkzh = tkzh;
	}

	public int getFyhj() {
		return fyhj;
	}

	public void setFyhj(int fyhj) {
		this.fyhj = fyhj;
	}

	public int getFkfs() {
		return fkfs;
	}

	public void setFkfs(int fkfs) {
		this.fkfs = fkfs;
	}

	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public User getAudit() {
		return audit;
	}

	public void setAudit(User audit) {
		this.audit = audit;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getDocName() {
		return docName;
	}

	public void setDocName(String docName) {
		this.docName = docName;
	}

	public List<SbItems> getSbItems() {
		return sbItems;
	}

	public void setSbItems(List<SbItems> sbItems) {
		this.sbItems = sbItems;
	}

	public ExtraData getData() {
		return data;
	}

	public void setData(ExtraData data) {
		this.data = data;
	}

	
	public String getExtraData() {
		return extraData;
	}

	public void setExtraData(String extraData) {
		this.extraData = extraData;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public int getZcjg() {
		return zcjg;
	}

	public void setZcjg(int zcjg) {
		this.zcjg = zcjg;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public WorkflowNode getCurNode() {
		return curNode;
	}

	public void setCurNode(WorkflowNode curNode) {
		this.curNode = curNode;
	}

	public String getNodeInfo() {
		return nodeInfo;
	}

	public void setNodeInfo(String nodeInfo) {
		this.nodeInfo = nodeInfo;
	}

	public String getNextOper() {
		return nextOper;
	}

	public void setNextOper(String nextOper) {
		this.nextOper = nextOper;
	}

	public boolean getHasFjtk() {
		return hasFjtk;
	}

	public void setHasFjtk(boolean hasFjtk) {
		this.hasFjtk = hasFjtk;
	}

	public String getFjtkAdd() {
		return fjtkAdd;
	}

	public void setFjtkAdd(String fjtkAdd) {
		this.fjtkAdd = fjtkAdd;
	}

	public String getFjtkDel() {
		return fjtkDel;
	}

	public void setFjtkDel(String fjtkDel) {
		this.fjtkDel = fjtkDel;
	}

	public Integer getFirstPay() {
		return firstPay;
	}

	public void setFirstPay(Integer firstPay) {
		this.firstPay = firstPay;
	}

	public String getLastPayDate() {
		return lastPayDate;
	}

	public void setLastPayDate(String lastPayDate) {
		this.lastPayDate = lastPayDate;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getBank() {
		return bank;
	}

	public void setBank(String bank) {
		this.bank = bank;
	}

	public String getBankNumber() {
		return bankNumber;
	}

	public void setBankNumber(String bankNumber) {
		this.bankNumber = bankNumber;
	}

	public String getZfbBank() {
		return zfbBank;
	}

	public void setZfbBank(String zfbBank) {
		this.zfbBank = zfbBank;
	}

	public String getAuditMemo() {
		return auditMemo;
	}

	public void setAuditMemo(String auditMemo) {
		this.auditMemo = auditMemo;
	}

	public Date getFinishTime() {
		return finishTime;
	}

	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}
}
